require 'pry'

class User
	attr_accessor :name, :password, :profile_picture, :friends, :wall
	
	def initialize(name, password, profile_picture)
		@name = name
		@password = password #don't actually do this - hash it
		@profile_picture = profile_picture
		@wall = []
		@friends = []
	end
	
	def post_on_wall(content, other_user)
		if other_user.friends.include?(self.name)
			new_post = {
				id: other_user.wall.length + 1,
				likes: 0,
				timestamp: Time.now,
				content: content,
				comments: []
				}
			other_user.wall << new_post
		else
			puts "You're not friends yet! Friend tha homie first."
		end
	end
	
	def add_friend(other_user)
		other_user.friends << self.name
	end
	
end

astor = User.new("Jeff Astor", "super-secret-password", "https://media.licdn.com/mpr/mpr/shrinknp_200_200/p/2/005/04f/1e9/00eb89f.jpg")
tomas = User.new("Tomas Molina", "smashword", "http://oceanicteam.com/wp-content/uploads/2015/03/molina.jpg")

binding.pry